<template>
	<view class="container">
		<u-notify ref="uNotify"></u-notify>
		<boss-send-job ref="sendjob" v-if="userType2 == 1 && token" :isShowBoss="isShowBoss"></boss-send-job>
		<view class="box" v-if="userType2 != 1">
			<staff-view :word="word" ref="staff" :upLocation="upLocation" :vipFlag="vipFlag" @toParents='toParents'
				:contentMessage='contentMessage' :zimuAutoplay="zimuAutoplay" :mergeMessage="mergeMessage"
				:boolFlag="boolFlag"></staff-view>
			<hans-tabber :indexNum="0" v-if="userType2 == 1" style="position:fixed;bottom:0;width:100%;left:0;right:0;">
			</hans-tabber>
		</view>
		<!-- 周冲 -->
		<view class="modal show" @touchmove.stop.prevent="() => false" :style="{ display: isShowPost22 }"
			@click="onConfirmClicks">
			<canvas canvas-id="invitation-post"
				:style="{ width: '708rpx', height: '805rpx', position: 'fixed', top: '-9999px', left: '70rpx' }"></canvas>
			<view class="my-post" :style="{ width: '708rpx', height: '805rpx' }">
				<image class="bg" @click="tochong()" src="../../static/zc.png"
					:style="{ width: '708rpx', height: '805rpx' }" mode="aspectFit"></image>
				<image @click="onConfirmClicks" class="close" src="/static/icon1/07.png"></image>
			</view>
		</view>
		<!-- 新人优惠  isNew-->
		<view class="modal show" @touchmove.stop.prevent="() => false" :style="{ display: isNew }"
			@click="onConfirmClickNew">
			<canvas canvas-id="invitation-post"
				:style="{ width: '708rpx', height: '778rpx', position: 'fixed', top: '-9999px', left: '70rpx' }"></canvas>
			<view class="my-post" :style="{ width: '708rpx', height: '778rpx' }">
				<view class="bgNew" @click="toNew()">
					<text>{{ countNew }} </text>
				</view>
				<image @click="onCloseNew" class="close" src="/static/icon1/07.png"></image>
			</view>
		</view>
		<!-- 账号被限制接单中 -->
		<popupWatch v-if="isShowPw" @closePwPage="closePwPage"></popupWatch>
		<!-- 助力解禁 -->
		<jffuchuang v-if="isFengjin && isShowPw == false"></jffuchuang>
		<Draggable :y='630' v-if="showToop">
			<view class="toops zwyShake" @click="toNew">
				<text>
					{{ countNew }}
				</text>
			</view>
		</Draggable>
		<!-- 晋升助手 -->
		<Draggable :y='720' v-if="userType == 0 && token">
			<view class="helper" @click="clickVideo">晋升助手</view>
		</Draggable>
		<studyVideo v-if='showGrow' @toClose='toClose' :isStydu='userInfo.studyFlag' :video='video'
			:typeVide='typeVide'>
		</studyVideo>
	</view>
</template>
<script>
	import {
		Registration_activities
	} from '@/libs/unit.js'
	import hansTabber from '../../components/hans-tabbar/hans-tabbar.vue'
	import permission from '@/libs/permission.js' //权限插件
	import placeMap from '@/libs/place-map.js'
	import staffView from './staff'
	import bossSendJob from '@/pages/app-employer/send-job/send-job-new'
	import {
		baseURL
	} from '@/config'
	import wybModal from '@/components/wyb-modal/wyb-modal.vue'
	import wybModalindex from '@/components/wyb-modal/wyb-modalindex.vue'
	import unit from '../../libs/newUnit.js'
	import popupWatch from '../../components/xjbg/popupWatch.vue'
	import jffuchuang from '../../components/xjbg/jf-fuchuang.vue'
	import studyVideo from '../../components/helpMosk/mosk.vue'
	export default {
		components: {
			staffView,
			bossSendJob,
			wybModal,
			wybModalindex,
			hansTabber,
			popupWatch,
			jffuchuang,
			studyVideo,
		},
		provide() {
			return {
				zimuAutoplay: this.zimuAutoplay
			}
		},
		data() {
			return {
				video: '',
				typeVide: 0,
				upLocation: false, //定位授权时更新显示的位置
				token: '',
				userInfo: {
					user: {},
					params: {}
				}, //当前用户信息
				userType: '', //用户类型0 雇员，1雇主
				userType2: uni.getStorageSync('userType'), //用户类型0 雇员，1雇主
				word: '', //搜索关键字
				lat: '', //当前用户位置
				lng: '', //当前用户位置
				isShowBoss: 0,
				isShowStaff: 0,
				location: [], //存储的定位
				postUrl: '', //海报
				region: '', //当前区域代码
				isShowPost: 'none', //是否显示海报
				imgPaths: '',
				PopupWatchImg: {
					img: '',
					path: '',
				}, //弹窗图片对象 图片地址 跳转地址 宽 高
				isFullScreen: false, //是否全面屏、刘海屏
				isFengjin: false,
				isShowPw: false,
				tempTrade: '',
				pagePath: '',
				isShowPost22: 'none',
				vipFlag: '',
				isNew: 'none', //新雇员的活动
				countNew: 0, //新手送多少钱
				showToop: false,
				showGrow: false,
				contentMessage: {},
				zimuAutoplay: true,
				deviceInfo: null,
				webviewUrl: 'https://zlg-h5.linglinggong.net/newMap.html?userKeyId=',
				mergeMessage: {}, //封禁评分等几个接口合并数据
				boolFlag: false
			}
		},
		onLoad() {
			// 获取用户设备基础信息
			let device = uni.getDeviceInfo();
			this.deviceInfo = device.deviceId
			uni.setStorageSync("systerr", "2")
			if (uni.getStorageSync('token')) {
				this.token = uni.getStorageSync('token')
				//获取用户信息
				// #ifdef APP-PLUS
				setTimeout(() => {
					this.iosNotificationAuthority() // 苹果通知权限
				}, 1000)
				// #endif
			} else {
				if (this.userType2 == 1) {
					uni.hideTabBar()
				}
			}
		},
		onShow() {
			if (uni.getStorageSync('breakNew') == 1) {
				this.$refs.staff.changeTask(1)
				uni.setStorageSync('breakNew', '')
			}
			uni.hideTabBar()
			if (uni.getStorageSync('token')) {
				this.get_user_query()
				//是否展示周冲
				if (uni.getStorageSync('zhouchong')) {
					this.isShowPost22 = ''
				}
				//是否展示 提示框
				this.showToop = uni.getStorageSync('NewPeopleRedBag')
				//是否展示 新手活动
				if (uni.getStorageSync('queryNewEmployeeWhether')) {
					this.isNew = ''
				} else {
					this.isNew = 'none'
				}
				if (uni.getStorageSync('NewPeopleRedBag')) {
					this.countNew = uni.getStorageSync('queryNewEmployeeAmount')
				}
				this.$nextTick(() => {
					this.getUserToken()
				})
			}
			this.word = uni.getStorageSync('word')
			if (uni.getStorageSync('shuaxin')) {
				this.onRefresh()
				uni.removeStorageSync('shuaxin')
			}
			uni.$once('ShowStaff', () => {
				this.onRefresh()
			})
			if (uni.getStorageSync('userType') == 0) {
				this.zimuAutoplay = true
				if (uni.getStorageSync('token')) {
					this.$nextTick(() => {
						this.$refs.staff.undoneRefresh()
						this.$refs.staff.refreshMenu()
					})
				}
			}
		},
		onHide() {
			this.zimuAutoplay = false
		},
		onReady() {
			uni.$on('closeFjin', this.closePwPage2)
			if (uni.getStorageSync('userType') == -1) { // 未选择身份的 跳转到选择页面
				uni.reLaunch({
					url: '/pages/select-identity/select-identity'
				})
			} else if (uni.getStorageSync('userType') == 1) {
				uni.hideTabBar()
				uni.navigateTo({
					url: '/pages/app-employer/send-job/send-job-new',
					animationType: 'fade-in',
					animationDuration: 100
				})
			}
		},
		methods: {
			fengjinMessage() {
				unit.Closure_time().then(v => {
					this.isFengjin = v.data == 0 ? false : v.data.status == 0 ? true : false
					if (uni.getStorageSync('yajinItem') != '' && v.data.expireTime != uni.getStorageSync(
							'yajinItem').expireTime) {
						unit.Closure_margin()
					}
					if (this.isFengjin) {
						uni.setStorageSync('date', new Date().toISOString().slice(0, 10))
						this.isShowPw = true
						return
					} else {
						this.isShowPw = false
					}
					if (uni.getStorageSync('FengjinItem')) {
						this.isFengjin = uni.getStorageSync('FengjinItem').status == 0 ? true : false
					}
				})
			},
			//封禁评分等几个接口合并数据
			async get_user_query() {
				let res = await this.$fetch(this.$api.get_user_query, {}, 'GET')
				if (res.code) uni.showToast({
					title: res.msg,
					icon: 'none'
				})
				this.mergeMessage = res.data
				this.boolFlag = res.data.boolFlag
				// 记录弹框次数
				uni.setStorageSync('showMask', res.data.popupsList)
				//是否被封禁
				if (res.data.bool) {
					this.fengjinMessage()
				} else {
					this.isFengjin = false
				}
				//是否展示周冲
				if (res.data.queryZhouChongFlag) {
					this.isShowPost22 = ''
				}
				if (res.data.orderFlag) {
					this.$refs.staff.ConfirmInvitationId.push(res.data)
					this.$refs.staff.invitationCountDown(res.data.orderCreateTime, res.data.orderId, res.data
						.orderStatus)
				} else {
					this.$refs.staff.invitationCountDown()
				}
				//是否展示 提示框
				this.showToop = res.data.queryNewEmployeeWhetherFloating
				//是否展示 新手活动
				if (res.data.queryNewEmployeeWhether) {
					this.isNew = ''
					this.countNew = res.data.queryNewEmployeeAmount
				} else {
					this.isNew = 'none'
				}
				//三重礼
				if (res.data.New_people_share_rewards) {
					this.$refs.staff.getNew_people_share_rewards(res.data.New_people_share_rewards)
				}
			},
			uploadImgs(url) {
				this.$refs.staff.uploadImgs(url)
			},
			toParents() {
				this.isShowPw = true
			},
			//获取用户信息
			async getUserToken() {
				let res = await this.$fetch(this.$api.get_user_by_token, {}, 'POST')
				// userIdentityStatus, // /用户身份：0 试用零工 1 正式零工 2 金牌晋升期
				// idCardNum, //实名认证
				// frockFlag, //是否购买工装  0 否  1 是  studyFlag 是否学习   ,ensureAccount 保证金
				this.contentMessage = res.data
				let status = res.data.userIdentityStatus
				this.typeVide = 10;
				switch (status) {
					case 0:
						this.video =
							'https://images.linglinggong.net/%E8%AF%95%E7%94%A8%E6%99%8B%E5%8D%87%E5%8A%A9%E6%89%8B%E8%A7%86%E9%A2%91.mp4'
						break
					case 1:
						this.video =
							'https://images.linglinggong.net/%E6%AD%A3%E5%BC%8F%E6%99%8B%E5%8D%87%E5%8A%A9%E6%89%8B%E8%A7%86%E9%A2%91.mp4'
						break
					case 2:
						this.video =
							'https://images.linglinggong.net/%E9%87%91%E7%89%8C%E6%99%8B%E5%8D%87%E5%8A%A9%E6%89%8B%E8%A7%86%E9%A2%91.mp4'
						break
				}
			},
			clickVideo() {
				this.showGrow = true
				this.getUserInfo()
			},
			toClose() {
				this.showGrow = false
			},
			onConfirmClickNew() {
				this.isNew = 'none'
			},
			// 关闭新手
			onCloseNew() {
				this.isNew = 'none'
			},
			//去周冲
			tochong() {
				this.isShowPost22 = 'none'
				uni.navigateTo({
					url: '/pages/chong-award/chong-award',
				})
			},
			// 新雇员活动
			toNew() {
				this.isNew = 'none'
				uni.navigateTo({
					url: '/pages/newStaff/newStaffRedEnvelope'
				})
			},
			onRefresh() {
				this.$refs.staff.refresh()
			},
			on_order_detail() {
				var pages = getCurrentPages() // 获取栈实例
				var page = pages[pages.length - 2]
				console.log(pages)
				if (page.route.includes('/pages/order-detail/order-detail')) {
					this.$refs.staff.refresh()
				}
			},
			on_job_detail() {
				var pages = getCurrentPages() // 获取栈实例
				var page = pages[pages.length - 2]
				console.log(pages)
				if (page.route.includes('/p/pages/job-detail/job-detail')) {
					this.$refs.staff.refresh()
				}
			},
			// 关闭推送
			async exitCloseCid() {
				let res = await this.$fetch(this.$api.upd_user_detail, {
					cid: 0
				}, 'POST')
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
			},
			// 用户同意协议
			onConfirmClick() {
				uni.setStorageSync('first-is', true)
				if (uni.getStorageSync('userType') == 1) {
					uni.navigateTo({
						url: '/pages/app-employer/send-job/send-job-new',
						animationType: 'fade-in',
						animationDuration: 100
					})
				}
			},
			// 海报点击x，取消
			onConfirmClicks: function() {
				//	console.log("wwwwwwwwwwwww")
				this.isShowPost22 = 'none' //是否显示海报
				this.isShowPost = 'none' //是否显示海报
				uni.setStorageSync('date', new Date().toISOString().slice(0, 10))
				if (uni.getStorageSync('userType') == 1) {
					uni.navigateTo({
						url: '/pages/app-employer/send-job/send-job-new',
						animationType: 'fade-in',
						animationDuration: 100
					})
				}
			},
			//弹窗点击事件
			OnPopupWatch() {
				console.log(this.PopupWatchImg[1], 789)
				if (this.PopupWatchImg[1] === "跳转路径") {
					plus.share.getServices(res => {
						let sweixin = null;
						for (let i in res) {
							if (res[i].id == 'weixin') {
								sweixin = res[i];
							}
						}
						//唤醒微信小程序
						if (sweixin) {
							sweixin.launchMiniProgram({
									id: uni.getStorageSync('UUID'),
									type: 0, //小程序版本  0-正式版； 1-测试版； 2-体验版。
									path: 'pages/wechat/chongFen/chongFen?isApp=true' //小程序的页面,用传的参数在小程序接值判断跳转指定页面
								},
								//目标小程序点击返回App后执行的回调,在此接收binderror="launchAppError"的参数
								res => {
									console.log(res)
								}, err => {
									console.log(err)
								});
						}
					});
				} else {
					console.log(this.PopupWatchImg[1], 123)
					uni.navigateTo({
						url: `/${this.PopupWatchImg[1]}`
					})
					this.isShowPost = 'none'
					uni.setStorageSync('date', new Date().toISOString().slice(0, 10))
				}
			},
			// 海报点击去发布
			handleClosePost() {
				this.isShowPost = 'none' //是否显示海报
				uni.setStorageSync('date', new Date().toISOString().slice(0, 10))
				uni.setStorageSync("userd", "5")
			},
			// 获取当前用户信息
			async getUserInfo() {
				let res = await this.$fetch(this.$api.get_current_user, {}, 'GET')
				this.vipFlag = res.data.user.vipFlag
				if (res.data.payPwdFlag) {
					uni.setStorageSync('isHavePayPassword', true)
				} else {
					uni.setStorageSync('isHavePayPassword', false)
				}
				if (res.code) return
				// 整理数据,res.data.user为空，则改为""
				Object.getOwnPropertyNames(res.data.user).forEach(function(key) {
					res.data.user[key] = res.data.user[key] == null ? '' : res.data.user[key]
				})
				res.data.user.avatar = res.data.user.avatar ? res.data.user.avatar : ''
				res.data.user.sex = res.data.user.sex ? res.data.user.sex.toString() : '0' //讲数字变成字符串
				uni.setStorageSync('userInfo', res.data)
				uni.setStorageSync('userType', res.data.userType)
				uni.setStorageSync('userId', res.data.user.userId)
				uni.setStorageSync("level", res.data.user.level) //用户等级
				this.userInfo = res.data
				this.userType = res.data.userType
				this.setTabr()
				// 切换底部导航栏
				uni.$emit('userLogin', {
					online: 1
				})
				// #ifdef APP-PLUS
				// #endif
				// 获取海报
				this.getPostUrl()
			},
			// 切换底部导航栏
			setTabr() {
				if (this.userType2 == 1) {
					this.isShowPost = 'none'
					uni.hideTabBar()
				} else if (this.userType2 == 0) {
					// uni.showTabBar()
					setTimeout(() => {
						uni.setTabBarItem({
							index: 0,
							text: '零工',
							"iconPath": "static/tab-bar/1.png",
							"selectedIconPath": "static/tab-bar/2.png",
						})
						uni.setTabBarItem({
							index: 1,
							text: '接单',
							"iconPath": "static/tab-bar/3.png",
							"selectedIconPath": "static/tab-bar/4.png",
						})
					}, 1000)
					if (new Date().toISOString().slice(0, 10) != uni.getStorageSync('date')) {
						if (uni.getStorageSync('userType') == 1) {
							this.isShowPost = 'none'
						} else {
							try {
								this.getStaffPopupWatch()
							} catch (e) {
								//TODO handle the exception
							}
							setTimeout(() => {
								this.isShowPost = ''
							}, 800)
						}
					}
				} else {
					// uni.showTabBar()
				}
			},
			//获取雇员弹窗
			getStaffPopupWatch() {
				this.pagePath = uni.getStorageSync('property_list_by_type').Systememployee.split(',')[1]
				this.PopupWatchImg = uni.getStorageSync('property_list_by_type').staff_popup_watch.split(",")
			},
			//获取新雇员活动弹窗
			getNewStaffPopupWatch() {
				this.PopupWatchImg = uni.getStorageSync('property_list_by_type').new_staff_popup_watch.split(",")
				if (uni.getStorageSync('userInfo').receivenumstatus == 0) {
					Registration_activities()
				}
			},
			// 获取海报
			getPostUrl() {
				let userInfo = uni.getStorageSync('userInfo')
				let qrcode = uni.getStorageSync('qrcode')
				let avatar = uni.getStorageSync('imgPath') + this.userInfo.user.avatar
				let userName = this.userInfo.user.userName
				this.createdPost(avatar, userName, qrcode)
			},
			// 获取当前时间和缓存时间(一天一次)
			get_nowTime(futrue) {
				// 执行这个存储的话就代表今日已展示过，今日不管什么时间段进入都不会执行以下代码
				let nowTime = new Date();
				let futrueTime;
				if (futrue) {
					futrueTime = new Date(futrue); // 缓存时间
				} else {
					// 没有的话就获取今天的时间
					futrueTime = new Date();
					// 缓存时间
					uni.setStorageSync('showNewTime', futrueTime);
				}
				// 当天日期 和 缓存前一天的日期做对比
				if (futrueTime && new Date(futrueTime).toDateString() === nowTime.toDateString()) {
					return false;
				} else {
					// 如果今日没有执行的话就给存储起来，今日就不会再执行了
					uni.setStorageSync('showNewTime', nowTime)
					return true;
				}
			},
			// 获取配置数据
			async getData() {
				// 直接取缓存 取得的时候是undefined
				let time = uni.getStorageSync('showNewTime'); // 存储的前一天(也可能是今天)
				let flag = this.get_nowTime(time);
				let expect_type = uni.getStorageSync('expect_type'),
					workTime = uni.getStorageSync("workTime"),
					street = uni.getStorageSync('street'),
					work_type = uni.getStorageSync("work_type"),
					opinionType = uni.getStorageSync('opinionType'),
					hotList = uni.getStorageSync('hotList');
				let pic_url = uni.getStorageSync('pic_url'),
					bond = uni.getStorageSync('bond'),
					telephone = uni.getStorageSync('telephone'),
					imgPath = uni.getStorageSync('imgPath'),
					x_hours_no_order = uni.getStorageSync('x_hours_no_order'),
					order_user_cancel_cut_integrity = uni.getStorageSync('order_user_cancel_cut_integrity'),
					task_user_cancel_cut_integrity = uni.getStorageSync('task_user_cancel_cut_integrity'),
					real_auth_integrity = uni.getStorageSync('real_auth_integrity'),
					user_amount_ratio = uni.getStorageSync('user_amount_ratio');
				if (flag || (!expect_type && !workTime && !street && !work_type && !opinionType && !hotList) || (!
						pic_url && !bond && !telephone && !imgPath && !x_hours_no_order && !
						order_user_cancel_cut_integrity && !task_user_cancel_cut_integrity && !real_auth_integrity && !
						user_amount_ratio)) {
					console.log('今日还没有执行，执行一次');
					let res = await this.$fetch(this.$api.get_all_property_list, {}, 'GET')
					//期望类型
					uni.setStorageSync('expect_type', res.data.dlg_expect_type)
					// 期望工作时间
					uni.setStorageSync('workTime', res.data.dlg_workTime)
					// 街道 
					uni.setStorageSync('street', res.data.dlg_street)
					// 期望工作类型
					uni.setStorageSync('work_type', res.data.dlg_expect_work_type)
					// 意见反馈类型
					uni.setStorageSync('opinionType', res.data.dlg_opinion_type)
					// 热门搜索
					uni.setStorageSync('hotList', res.data.dlg_hot_search)
					let res4 = await this.$fetch(this.$api.property_list_by_type, {
						type: 1
					}, 'POST')
					// pic_url  bond  telephone
					// platform_prompt  x_hours_no_order  order_user_cancel_cut_integrity  task_user_cancel_cut_integrity
					// real_auth_integrity user_amount_ratio
					// 平台提示
					uni.setStorageSync('platform_prompt', res4.data.platform_prompt)
					// 获取图片路径
					uni.setStorageSync('imgPath', res4.data.pic_url)
					// 发布任务时 缴纳保证金配置(元/人)
					uni.setStorageSync('bond', res4.data.bond)
					// 雇员取消x小时内不可接单
					uni.setStorageSync('x_hours_no_order', res4.data.x_hours_no_order)
					// 雇员取消订单扣除诚信值
					uni.setStorageSync('order_user_cancel_cut_integrity', res4.data.order_user_cancel_cut_integrity)
					// 雇主取消任务扣除诚信值
					uni.setStorageSync('task_user_cancel_cut_integrity', res4.data.task_user_cancel_cut_integrity)
					// 实名认证诚信值配置
					uni.setStorageSync('real_auth_integrity', res4.data.real_auth_integrity)
					// 客服电话
					uni.setStorageSync('serviceTelephone', res4.data.telephone)
					//收取雇员百分之4手续费
					uni.setStorageSync('user_amount_ratio', res4.data.user_amount_ratio)
				} else {
					console.log('今日已经执行了，别调了')
				}
				if (!uni.getStorageSync("uploadToken")) {
					// 获取七牛上传TOKEN
					let res5 = await this.$fetch(this.$api.get_qiniu_token, {}, 'POST')
					uni.setStorageSync('uploadToken', res5.msg)
				}
			},
			// 创建画布
			createdPost(avatar, userName, qrcode) {
				const ctx = uni.createCanvasContext('invitation-post')
				//背景图片
				ctx.drawImage('/static/icon1/08.png', 0, 0, 305, 403)
				//用户名
				ctx.setFillStyle('#402110')
				ctx.font = "bold 14px PingFangSC-Medium";
				ctx.fillText(userName, 160 / 2, 40 / 2 + 20)
				const metrics = ctx.measureText(userName)
				//说明
				ctx.setFillStyle('rgba(64,33,16,0.50)')
				ctx.font = "12px PingFangSC-Regular";
				ctx.fillText('扫码加入“找零工”，开启“滴滴招人”', 163 / 2, 90 / 2 + 17)
				//二维码
				ctx.drawImage(qrcode, 58 / 2, 210 / 2, 496 / 2, 496 / 2)
				//提示
				ctx.setFillStyle('#402110')
				ctx.font = "14px PingFangSC-Regular";
				ctx.fillText('长按二维码保存至相册', 166 / 2, 726 / 2 + 20)
				//任务头像
				ctx.arc(85 / 2, 85 / 2, 22.5, 0, 2 * Math.PI) // 画圆
				ctx.clip()
				ctx.drawImage(avatar, 40 / 2, 40 / 2, 45, 45)
				setTimeout(() => {
					ctx.draw(false, () => {
						uni.canvasToTempFilePath({
							canvasId: 'invitation-post',
							success: (res) => {
								uni.hideLoading()
								this.postUrl = res.tempFilePath
								uni.setStorageSync('postUrl', res.tempFilePath)
							},
							fail: (err) => {
								console.log('画图失败', err)
							}
						})
					})
				}, 100)
			},
			// 苹果推送通知
			iosNotificationAuthority() {
				if (plus.os.name != 'Android') {
					// 没有苹果通知权限
					if (!permission.judgeIosPermission("push")) {
						uni.showModal({
							title: '提醒',
							content: '请在权限管理中同意通知授权',
							confirmText: '去开启',
							// showCancel: false, // 不显示取消按钮
							success(res) {
								if (res.confirm) {
									permission.gotoAppPermissionSetting()
								} else if (res.cancel) {
									console.log('用户点击取消');
								}
							}
						})
					}
				}
			},
			closePwPage2() {
				this.isShowPw = false
				this.isFengjin = false
			},
			closePwPage() {
				this.isShowPw = false
				if (uni.getStorageSync('FengjinItem')) {
					this.isFengjin = uni.getStorageSync('FengjinItem').status == 0 ? true : false
				}
			},
			getKey() {
				let res = uni.request({
					url: "http://127.0.0.1:5500/newMap.html?userKeyId=111111",
					method: "GET"
				})
			},
		},
	}
</script>
<style scoped lang="less">
	page {
		background-color: #FFF;
	}

	.container {
		&>.modal {
			z-index: 9;
			width: 100vw;
			height: calc(100vh - var(--status-bar-height) + 192rpx);
			pointer-events: none;
			background: transparent;
			transition: all .3s;
			position: fixed;
			top: 0;
			padding-top: calc(var(--status-bar-height) + 16rpx);
			z-index: 3333;
			background-color: #FFFFFF;

			&.show {
				display: flex;
				width: 100%;
				height: 100%;
				top: 0rpx;
				background: rgba(0, 0, 0, 0.40);
				pointer-events: auto;
				text-align: center;
				z-index: 9999;
			}

			.my-post {
				position: absolute;
				top: 0rpx;
				left: 50%;
				top: 50%;
				transform: translate(-50%, -50%);
				width: 400rpx;
				height: 400rpx;

				.bg {
					width: 400rpx;
					height: 400rpx;
					display: inline-block;
					animation: zoomInDown 1s ease-in 0s 1;
				}

				.bgNew {
					width: 100%;
					height: 778rpx;
					display: inline-block;
					animation: zoomInDown 1s ease-in 0s 1;
					background: url('../../static/icon3/xinrengongshihongbao/newS.png')center center/100% no-repeat;

					&>text {
						font-size: 234rpx;
						color: #FFF8AE;
						display: block;
						margin-top: 136rpx;
						height: 600rpx;
					}
				}
			}

			.close {
				position: absolute;
				left: -30rpx;
				top: -20rpx;
				width: 70rpx;
				height: 70rpx;
				z-index: 111;
			}
		}
	}

	@keyframes zoomInDown {
		from {
			opacity: 0;
			-webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0);
			transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0);
			-webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
			animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
		}

		60% {
			opacity: 1;
			-webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
			transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
			-webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
			animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
		}
	}

	.toops {
		width: 110rpx;
		height: 140rpx;
		background: url('../../static/icon3/xinrengongshihongbao/newBg.png') center center/cover no-repeat;
		position: fixed;
		bottom: 60%;
		right: 30rpx;
		z-index: 98;
		z-index: 66;
		text-align: center;
		overflow: hidden;
		transform-origin: center bottom;
		animation: zwyShake 2s 0.5s ease-out infinite;

		&>text {
			margin-top: 30rpx;
			font-size: 36rpx;
			font-weight: bold;
			color: #FFF8AE;
			display: block;
		}
	}

	@keyframes zwyShake {
		0% {
			transform: rotate(0deg);
			transition-timing-function: cubic-bezier(0.215, .61, .355, 1);
		}

		10% {
			transform: rotate(-12deg);
			transition-timing-function: cubic-bezier(0.215, .61, .355, 1);
		}

		20% {
			transform: rotate(12deg);
			transition-timing-function: cubic-bezier(0.215, .61, .355, 1);
		}

		28% {
			transform: rotate(-10deg);
			transition-timing-function: cubic-bezier(0.215, .61, .355, 1);
		}

		36% {
			transform: rotate(10deg);
			transition-timing-function: cubic-bezier(0.755, .5, .855, .06);
		}

		42% {
			transform: rotate(-8deg);
			transition-timing-function: cubic-bezier(0.755, .5, .855, .06);
		}

		48% {
			transform: rotate(8deg);
			transition-timing-function: cubic-bezier(0.755, .5, .855, .06);
		}

		52% {
			transform: rotate(-4deg);
			transition-timing-function: cubic-bezier(0.755, .5, .855, .06);
		}

		56% {
			transform: rotate(4deg);
			transition-timing-function: cubic-bezier(0.755, .5, .855, .06);
		}

		60% {
			transform: rotate(0deg);
			transition-timing-function: cubic-bezier(0.755, .5, .855, .06);
		}

		100% {
			transform: rotate(0deg);
			transition-timing-function: cubic-bezier(0.215, .61, .355, 1);
		}
	}

	// 晋升助手
	.helper {
		width: 152rpx;
		height: 58rpx;
		border-radius: 60rpx 0rpx 0rpx 60rpx;
		position: fixed;
		right: 0;
		bottom: 30rpx;
		z-index: 99;
		color: #fff;
		font-size: 24rpx;
		background: linear-gradient(135deg, #00B554 0%, #00B682 100%);
		box-shadow: 4rpx 6rpx 8rpx 2rpx rgba(29, 110, 45, 0.4);
		text-align: center;
		line-height: 58rpx;
	}
</style>